<!--<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>-->

<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <base href="<%=basePath%>">

    <title>添加任务</title>

    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <!--
    <link rel="stylesheet" type="text/css" href="styles.css">
    -->
    <!--	<%@include file="../../script.html" %>-->
    <link th:insert="~{views/script :: tiancai}"/>
</head>

<body style="width:100%;max-width:600px;padding:30px 60px;">
<section class="info-section">
    <form id="form" method="post">
        <table>
            <tr>
                <td class="text-title">创建者名：</td>
                <td class="text-content">
                    <input type="hidden" name="id" >
                    <select data-options="required:true,validType:'length[2,10]'" name="creatorUserId">
                        <option th:each="l:${list}"  th:value="${l.getId()}">[[${l.getUserName()}]]</option>
                    </select>
                </td>
            </tr>

            <tr>
                <td class="text-title">联系人姓名 </td>
                <td class="text-content">
                    <input type="text" name="conname"
                           class="easyui-textbox theme-textbox-radius"
                           data-options="required:true,validType:'length[2,10]'">
                </td>
            </tr>
            <tr style="display:${empty taskVo ? 'table-row' : 'none'};">
                <td class="text-title">所属客户</td>
                <td class="text-content">
                    <input type="text" name="conname"
                           class="easyui-textbox theme-textbox-radius"
                           data-options="required:true,validType:'length[2,10]'">
                </td>
            </tr>

            <tr>
                <td class="text-title">职位</td>
                <td class="text-content">
                    <input type="text" name="post"
                           class="easyui-textbox theme-textbox-radius"
                           data-options="required:true,validType:'length[2,10]'">
                </td>
            </tr>
            <tr>
                <td class="text-title">部门</td>
                <td class="text-content">
                    <input type="text" name="department"
                           class="easyui-textbox theme-textbox-radius" data-options="required:true"></td>
            </tr>
            <tr>
                <td class="text-title">性别</td>
                <td class="text-content">
                    <input type="text" name="sex"
                           class="easyui-textbox theme-textbox-radius" data-options="required:true"></td>
            </tr>
            <tr>
                <td class="text-title">电话</td>
                <td class="text-content">
                    <input type="text" name="telephone"
                           class="easyui-textbox theme-textbox-radius" data-options="required:true">
                </td>
            </tr>

            <tr>
                <td class="text-title">邮箱</td>
                <td class="text-content">
                    <input type="text" name="email"
                           class="easyui-textbox theme-textbox-radius" data-options="required:true">
                </td>
            </tr>
            <tr>
                <td class="text-title">qq</td>
                <td class="text-content">
                    <input type="text" name="qqNo"
                           class="easyui-textbox theme-textbox-radius" data-options="required:true,validType:'email'">
                </td>
            </tr>

            <tr>
                <td class="text-title">地址：</td>
                <td class="text-content">
                    <input type="text" name="address"
                           class="easyui-textbox theme-textbox-radius" data-options="required:true">
                </td>
            </tr>
            <tr>
                <td class="text-title">邮编</td>
                <td class="text-content">
                    <input type="text" name="zipCode"
                           class="easyui-textbox theme-textbox-radius" data-options="required:true">
                </td>
            </tr>
            <!-- 因为用户关联信息不需要修改，但是如果没有把这些信息传递给服务器端，hibernate对数据进行更新时就会把对应条目设置为null值 -->

            <tr style="display: none;">
                <td colspan="2">
                    <input type="hidden" name="isclose" value = "1">
                    <input type="hidden" name="deleteStatus" value="0">
<!--                    <input type="hidden" name="deleteTime" >-->
                </td>
            </tr>
            <tr>
                <td colspan="2" style="text-align: center;margin-top: 10px;">
                    <a href="javascript:void(0);" id="saveBtn" class="easyui-linkbutton button-primary">保存</a>
                    <a href="javascript:void(0);" id="resetBtn" class="easyui-linkbutton button-danger">重置</a>
                </td>
            </tr>
        </table>
    </form>
</section>
</body>
<script type="text/javascript">
    $(function () {
        $("#saveBtn").on("click", function () {
            $("#form").form("submit", {
                url: "/manage/contacts/ContactsAction_save.action",
                onSubmit: function () {
                    return $("#form").form("validate");
                },

                success: function (data) {
                    var obj = eval("(" + data + ")")
                    if (obj.success) {
                        $.messager.alert("提示", obj.message)
                        parent.closeTopWindow();
                    }
                }
            });
        })


        $("#resetBtn").on("click", function () {
            $("#form").form("reset")
        });
    })

</script>
</html>
